package com.wishu.finance.enums;

public enum UserType {
    B_USER(1, "B端用户"),
    C_USER(2, "C端用户"),
    ;

    public static UserType fromCode(int statusCode) {
        for (UserType status : values()) {
            if (status.code == statusCode) {
                return status;
            }
        }
        throw new IllegalArgumentException("No matching constant for [" + statusCode + "]");
    }

    private final int code;
    private final String name;

    UserType(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return this.code;
    }

    public String getName() {
        return this.name;
    }
}
